
package GUI;

import javax.swing.JFormattedTextField;


public class JanelaExcluirCliente extends javax.swing.JFrame {

    protected ControladorJanelaPrincipal cJC ;
    protected ControladorJanelaExcluir cJE;
    
    public JanelaExcluirCliente() {
        initComponents();
        setLocationRelativeTo(null);
    }

    public void setControladorJanelaExcluir(ControladorJanelaExcluir cJExcluir){
        cJE = cJExcluir;
        botaoExcluir.addActionListener(cJExcluir);
    }

    public void setControladorJanelaPrincipal (ControladorJanelaPrincipal c){
        cJC = c;

    }
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        labelNome = new javax.swing.JLabel();
        labelExcluirCliente = new java.awt.Label();
        botaoExcluir = new javax.swing.JButton();
        campoCPF = new javax.swing.JFormattedTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        labelNome.setText("CPF:");

        labelExcluirCliente.setFont(new java.awt.Font("Arial", 1, 18));
        labelExcluirCliente.setText("Excluir Cliente");

        botaoExcluir.setText("Excluir");

        try{
            campoCPF.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##")));
        }catch (Exception e)
        {

        }
        campoCPF.setToolTipText("\"\"");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(143, 143, 143)
                        .addComponent(botaoExcluir))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(19, 19, 19)
                        .addComponent(labelNome)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(campoCPF, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(126, 126, 126)
                        .addComponent(labelExcluirCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(142, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addComponent(labelExcluirCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(36, 36, 36)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelNome)
                    .addComponent(campoCPF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 132, Short.MAX_VALUE)
                .addComponent(botaoExcluir)
                .addGap(42, 42, 42))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents



    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botaoExcluir;
    private javax.swing.JFormattedTextField campoCPF;
    private java.awt.Label labelExcluirCliente;
    private javax.swing.JLabel labelNome;
    // End of variables declaration//GEN-END:variables

     public String getCampoCPF() {
        return campoCPF.getText();
    }

    public void setCampoCPF(String campoCPF) {
        this.campoCPF.setText(campoCPF);
    }


}
